
#include <iostream>
#include <vector>

using std::cout;
using std::endl;

template< typename T >
void swap( T* a, T* b )
{
	T temp;
	temp = *a;
	*a = *b;
	*b = temp;
}

template< typename T >
void sort( T* vet, const int size )
{
	T minor;
	int i, j;

	for( i = 0; i < size; i++ )
	{
		minor = vet[i];
		for( j = i + 1; j < size; j++ )
		{
			if( vet[j] < minor )
			{
				minor = vet[j];
				swap( &vet[i], &vet[j] );
			}
		}
	}
}

template< typename T >
void printVector( const T* vet, const int size )
{
	cout << "vet = [ ";

	for( int i = 0; i < size; i++ )
	{
		cout << vet[i] << " ";
	}

	cout << "]" << endl;
}


int main( void )
{
	int a[10] = { 7, 3, 5, 9, 1, 4, 2, 6, 8, 0 };
	float b[10] = { 7.3, 3.4, 5.6, 9.1, 1.9, 4.5, 2.7, 6.9, 8.4, 0.5 };

	printVector( a, 10 );
	sort( a, 10 );
	printVector( a, 10 );

	cout << endl;

	printVector( b, 10 );
	sort( b, 10 );
	printVector( b, 10 );

	return 0;
}

